package disk;

import eduni.simanim.Anim_applet;
import eduni.simjava.Sim_system;

/**
 *
 * @author eagle
 */
public class ProcessorSubsystem6 extends Anim_applet {

    // Setup the animation
    @Override
    public void anim_layout() {
        Source1 source = new Source1("Source", 10, 60, "source", 150.45);
        Sink processor = new Sink("Processor", 140, 60, "cpu", 110.5, 90.5);
        Disk disk1 = new Disk("Disk1", 370, 10, "disk1", 130.0, 65.0);
        Disk disk2 = new Disk("Disk2", 370, 110, "disk2", 350.5, 200.5);
        Sim_system.link_ports("Source", "Out", "Processor", "In");
        Sim_system.link_ports("Processor", "Out1", "Disk1", "In");
        Sim_system.link_ports("Processor", "Out2", "Disk2", "In");
    }

    @Override
    public void sim_setup() {
        Sim_system.set_transient_condition(Sim_system.TIME_ELAPSED, 10000);
        Sim_system.set_termination_condition(Sim_system.EVENTS_COMPLETED,
                "Processor", 0, 50, false);
        Sim_system.set_output_analysis(Sim_system.IND_REPLICATIONS, 2, 0.95);
        Sim_system.set_report_detail(true, false);
    }

    // Choose animation output detail
    @Override
    public void anim_output() {
        generate_report(true);
        generate_messages(true);
        Sim_system.generate_graphs(true);
    }
}
